﻿using Microsoft.EntityFrameworkCore;
using PHMEE.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.EntityFrameworkCore;

namespace PHMEE.Repositories.BaseInfo.Points
{
    public class PointRepository : BaseRepository<Point, Guid>, IPointRepository
    {
        public PointRepository(IDbContextProvider<PHMEEDbContext> dbContextProvider) : base(dbContextProvider)
        {
        }
        /// <summary>
        /// 根据id查询所有测点
        /// </summary>
        /// <param name="ids"></param>
        /// <returns></returns>

        public async Task<List<Point>> GetPointByIdAsync(List<Guid> ids)
        {
            var dbContext = await GetDbContextAsync();

            return await dbContext.Points
                .Where(p => ids.Contains(p.Id))
                .ToListAsync();
        }
    }
}
